<template>
  <div class='box-wrap-wskt'>
    <div class='box-operation'>
      <div class="box-search">
        <div class='form-group-enquire'><el-Input v-model.trim="searchData.user_name" placeholder="用户名" clearable  @on-enter="onSearchGetList()"></el-Input></div>
        <div class='form-group-enquire'><el-Input v-model.trim="searchData.task_name" placeholder="任务名" clearable @on-enter="onSearchGetList()"></el-Input></div>
        <div class='form-group-enquire'>
          <el-select v-model="searchData.business_type" placeholder="业务类型" clearable filterable>
            <el-option :value=row.id v-for="row in business_list" :label="row.name" :key=row.id><span>{{row.name}}</span></el-option>
          </el-select>
        </div>
        <div class='form-group-enquire'>
          <el-select v-model="searchData.sieve_source_name" placeholder="请选择筛料源" clearable filterable>
            <el-option :value= row.name v-for="row in statuslist" :label="row.name" :key= row.id >{{row.name}}</el-option>
          </el-select>
        </div>
        <div class='form-group-enquire'>
          <el-select v-model="searchData.warehouse_type"  placeholder="筛料方向" clearable filterable >
            <el-option :value=row.id v-for="row in warehouse_list" :label="row.name" :key=row.id ><span>{{row.name}}</span></el-option>
          </el-select>
        </div>
        <div class='form-group-enquire'>
          <el-select v-model="searchData.country_id" placeholder="国家" clearable filterable :disabled="UserInfo.role=='商务'?true:false">
            <el-option :value=row.id v-for="row in countrylist" :label="row.name" :key=row.id ><span>{{row.name}}</span></el-option>
          </el-select>
        </div>
        <div class='form-group-enquire'>
          <el-select v-model="searchData.status" placeholder="状态" clearable filterable :disabled="UserInfo.role=='商务'?true:false">
            <el-option :value=row.id v-for="row in status_list" :label="row.name" :key=row.id ><span>{{row.name}}</span></el-option>
          </el-select>
        </div>
        <div class='form-group-enquire'>
          <DatePicker type="daterange" placeholder="请选择时间" :editable=false  v-model="searchDate" @on-change="changeDate" @on-clear="initDate"></DatePicker>
        </div>
        <div class='form-group-enquire' @click='onSearchGetList()'><img src="../../assets/images/peach-svg/Frame 23.svg" title="点击刷新"></div>
        <div class='form-group-addimg' @click='downloadFile()'><img src="../../assets/images/peach-svg/export.svg"></div>
        <div class="form-group-right-button">
          <div class='form-group-enquire'  @click='addSieveOpen2(3)'><img src="../../assets/images/peach-svg/export_list.svg"></div>
          <div class='form-group-enquire'  @click='addSieveOpen2(2)'><img src="../../assets/images/peach-svg/export_pl.svg"></div>
        </div>
      </div>
    </div>
    <LibVxeTable class="staticData"
      :tableColumns="tableColumns"
      :tableData="list"
      :slotHeader="slotHeader"
      border="none"
      :PageObj="{total:totalCnt,currentPage:searchData.page_index,pageSize:searchData.page_size,pageSizes:[30, 50, 100,1000]}"
      @onPageChange="onChangePageSize"
      @onSelectChange="onCheckChange"
      :stripe="false"
      :footer-method="footerMethodFunc"
      resizable>
     </LibVxeTable>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
import utils from "../../commons/utils";
import {commonMixin} from "../../components/ViewInitMixin" //每一个文件都要包含这个
import {TimePicker} from "iview"
import SearchUser from "../searchUser"
import Request from "../../commons/Request"
import {ACDN} from "@/commons/staticName";
import bus from "@/commons/EventBus";

export default {
  name: "addUserDetailView",  //!!这块一定要注意，每一个文件都根据资源path来命名
  components:{TimePicker,SearchUser},
  mixins:[commonMixin],
  data() {
    return {
      statuslist:[],
      searchDate:"",
      searchTime:[utils.dateFormat(0,"HH")+"00",utils.dateFormat(0,"HH")+"00"],
      searchData:{
        page_index:1,
        page_size:30,
        start:"",
        end:"",
        business_type:"",
        warehouse_type:"",
        country_id:"",
        status:'',
        task_name:"",
        user_name:"",
        op : "serach"
      },
      Dus:"",//单个下载还是多个
      task_number:"",
      valid_number:'',
      business_list:[{id:1,name:"筛有效"},{id:2,name:"筛活跃"},{id:3,name:"筛性别"},{id:4,name:"运营商标准筛"},{id:5,name:"运营商高级筛"},{id:2,name:"TK格式筛"}],
      business_obj:{1:"筛有效",2:"筛活跃",3:"筛性别"},
      warehouse_list:[{id:1,name:"ws筛料平台"},{id:2,name:"FB筛料平台"},{id:3,name:"INS筛料平台"},{id:4,name:"amazon筛料平台"},{id:5,name:"linkedin筛料平台"},{id:6,name:"viber筛料平台"},
      {id:7,name:"line 筛料平台"},{id:8,name:"zalo筛料平台"},{id:9,name:"twitter筛料平台"}, {id:10,name:"skype筛料平台"},{id:11,name:"tg筛料平台"},{id:12,name:"momo筛料平台"},
      {id:13,name:"MtnMOMO筛料平台"},{id:14,name:"微软账号筛平台"},{id:15,name:"TrueMoney筛料平台"},{id:16,name:"BOTIM筛料平台"},{id:17,name:"运营商筛料平台"},{id:18,name:"空号检测筛料平台"},{id:19,name:"TK筛料平台"}],
      status_list:[{id:1,name:"排队中"},{id:2,name:"进行中"},{id:3,name:"暂停中"},{id:4,name:"已停止"},{id:5,name:"已完成"}],
      warehouse_obj:{ 1:"WS",2:"FB",3:"INS",4:"Amazon",5:"Linkedin",6:"Viber",7:"Line",8:"Zalo",9:"Twitter",
      10:"Skype",11:"TG",12:"momo",13:"MtnMOMO",14:"微软账号",15:"TrueMoney",16:"BOTIM",17:"运营商",18:"空号检测",19:"TK"},
      time_at:"",
      time_mouth:"",
      selectRows:[],
      countrylist:[],
      sourcelist:[],
      countrylistObj:{},
      list:[],
      totalCnt:0,
      info:{},
      tableColumns:[
        {
        field: "Id",
        type:"checkbox",
        align: "center",
        width:50,
        },
        {
          title: "用户名",
          field: "user_name",
          align: 'center',
        },
        {
          title: "任务名",
          field: "task_name",
          align: 'center',
        },
        {
          title: "引擎任务id",
          field: "engine_task_id",
        },
        {
          title: "筛料/业务",
          field: "business_type",
          align: 'center',
          slots:{
            default: ({row},h) => {
              return this.$AutoFun(()=>{
              let reserse=this.business_obj[row.business_type]
              let reserse2=this.warehouse_obj[row.warehouse_type]
              if(row.warehouse_type == 17) {
                if(row.business_type == 1 ) {
                  reserse = '标准筛'
                }
                if(row.business_type == 2 ) {
                  reserse = '高级筛'
                }
              }
              if(row.warehouse_type == 19) {
                if(row.business_type == 2 ) {
                  reserse = '格式筛'
                }
              }
              return [ h("div",reserse2+"/"+reserse)];
            });
            }
          }
        },
        {
          title: "筛源",
          field: "sieve_source_name",
          align: 'center',
          slots:{
            default:({row},h) =>{
              if(row.sieve_source_name==0){
                return [h("div",'-')]
              }else
              return [h("div",row.sieve_source_name)]
            }
          }
        },
        {
          title: "国家",
          field: "country",
        },
        {
          title: "任务/有效数",
          field: "task_number",
          align: 'center',
          width:100,
          slots:{
            default: ({row},h) => {
              return [ h("div",row.task_number+"/"+row.valid_number)];
            }
          }
        },
         
        {
          title: "积分消耗(总/账户/赠送)",
          field: "valid_number",
          align: 'center',
          width:170,
          slots:{
            default: ({row},h) => {
              return [ h("div",row.points_consume_total/10000+"/"+row.points_consume_account/10000+"/"+row.points_consume_gift/10000)];
            }
          }
        },
        {
          title: "代理商利润",
          field: "agent_points",
          align: 'center',
          slots:{
            default:({row},h) =>{
              if(row.agent_points==0){
                return [h("div",'-')]
              }else{
                  let jifen = row.agent_points/10000
                  jifen = (String(jifen).indexOf('.') + 1 > 0 && ( String(jifen).length - (String(jifen).indexOf('.') + 1) > 4)) ? parseFloat(jifen).toFixed(4) :jifen
                  return [h("div",jifen)]
                }
            }
          }
        },
        {
          title: "平台消耗(总/账户/赠送)",
          field: "profit",
          align: 'center',
          width:170,
          slots:{
            default:({row},h) =>{
              if(row.profit==0){
                return [h("div",'-')]
              }else{
                  let jifen = row.profit/10000
                  jifen = (String(jifen).indexOf('.') + 1 > 0 && ( String(jifen).length - (String(jifen).indexOf('.') + 1) > 4)) ? parseFloat(jifen).toFixed(4) :jifen
                  let jifen2 = (row.profit * row.points_consume_account / row.points_consume_total)/10000
               jifen2 = (String(jifen2).indexOf('.') + 1 > 0 && ( String(jifen2).length - (String(jifen2).indexOf('.') + 1) > 4)) ? parseFloat(jifen2).toFixed(4) :jifen2
               let jifen3 = (row.profit * row.points_consume_gift / row.points_consume_total )/10000
                  jifen3 = (String(jifen3).indexOf('.') + 1 > 0 && ( String(jifen3).length - (String(jifen3).indexOf('.') + 1) > 4)) ? parseFloat(jifen3).toFixed(4) :jifen3
                  return [h("div",jifen+"/"+jifen2+"/"+jifen3)]
                }
            }
          }
        },
        {
          title: "状态",
          field: "status",
          align: 'center',
          // width:150,
          slots:{
            default: ({row},h) => {
              return this.$AutoFun(()=>{
              let hButton = [];
              if(row.status !== 2){
                hButton.push(h(
                    "div",
                    {
                      class:row.status==1?"eight":row.status==2?"four":row.status==3?"five":row.status==4?"six":row.status==5?"seven":"seven",
                    },
                  ));
                }else{
                  console.log(row.progress!=null);
                  if(row.progress!=null){
                    let count100= ( row.progress.complete_count / (row.progress.count  ) * 100).toFixed(2)
                    hButton.push(h(
                      "div",
                      {
                        class:row.status==1?"eight":row.status==2?"four":row.status==3?"five":row.status==4?"six":row.status==5?"seven":"seven",
                      }, 
                      [h('div',count100+'%')]//+"("+row.progress.complete_count+'/'+row.progress.count+")"
                    ));
                  }else{
                    hButton.push(h(
                    "div",
                    {
                      class:row.status==1?"eight":row.status==2?"four":row.status==3?"five":row.status==4?"six":row.status==5?"seven":"seven",
                    },
                  ));
                  }
                }
              return hButton;
            });
            }
          }
        },
        {
          title: "开始/完成时间",
          field: "start_time",
          align: 'center',
          width:  130,
          slots: {
            default: ({row},h) => {
                 return [h("div",(row.start_time==0?"--":utils.dateFormat(row.start_time, "yyyy-MM-dd HH:mm:ss"))
                 +"/"+(row.end_time==0?" --":utils.dateFormat(row.end_time, "yyyy-MM-dd HH:mm:ss")))];
            }
          }
        },
        {
          title: "操作",
          field: "action",
          align: "center",
          width:200,
          slots:{
            default: ({row},h) => {
              return this.$AutoFun(()=>{
              let hButton = [];
                hButton.push(
                  h(
                    "el-button",
                    {
                      props: { type: "success", size: "small" },
                      style: { marginRight: "5px",backgroundColor:"#3DD598" ,borderColor:"#3DD598"},
                      on: {
                        click: () => {
                          this.addWarehouse2(1,3,row,"单");
                        }
                      }
                    },
                    "任务导出"
                  )
                );
                hButton.push(
                  h(
                    "el-button",
                    {
                      props: { type: "success", size: "small" },
                      style: { marginRight: "5px" },
                      on: {
                        click: () => {
                          this.addWarehouse2(1,2,row,"单");
                        }
                      }
                    },
                    "有效导出"
                  )
                );
              return hButton;
            });
            }
          }
        }
      ],
      format: {
        number_of_single:{
          labelName: "单文件数量",
          labelType: "text",
          placeholder:"请输入单文件数量(最小值100个，最大值100w)",
          labelHide:false
        },
        export_format:{
          labelName: "导出格式",
          labelType: "radio",
          labelValue:[{"key":1,"value":"TXT格式"},{"key":2,"value":"CSV格式"}],
        },
        export_type:{
          labelName: "导出类型",
          labelType: "radio",
          labelValue:[{"key":1,"value":"WS群发格式"},{"key":2,"value":"短信格式"}],
        },
        export_mode:{
          labelName: "导出方式",
          labelType: "radio",
          labelValue:[{"key":2,"value":"全部导出"},{"key":1,"value":"分批导出"}],
          labelChange:"export_mode"
        },
        batched_file_count:{
          labelName: "导出数量",
          labelType: "radio",
          labelValue:[{"key":1,"value":"导出一个"},{"key":2,"value":"导出多个"}],
          labelHide:false
        },
      },
      ruleValidate: {
        // number_of_single: [{ required: true,message: "导出输量不能为空", trigger: "blur" }],
      },
      dateOptions:{
        disabledDate(date){
          return date && date.valueOf() > Date.now();
        },

      },
    };
  },
  computed: {
            ...mapGetters(["UserInfo"]),
        },
  methods: {
    async initView(isMounted){
      if(isMounted){
        this.initSearchData();
        this.onSearchGetList()
      }
    },
    async initSearchData(){
      let res = await Request.post("sys/country", "query_list");
      if (res.code == 0) {
        this.countrylistObj = {}
        this.countrylist = []
        if(res.code==0 && res.data != null){
            res.data.list.forEach((item) => {
            this.$set(this.countrylistObj,item.id,item.short_name+"_"+item.full_name)
            this.countrylist.push({id:item.id,name:item.short_name+"_"+item.full_name});
            })
        }
      }
      let res2 = await Request.post("customer/sieveConfig","query_list")//筛料源接口
      let label=''
      if(res2.code==0 && res2.data.length != 0){
        res2.data.list.forEach(res2 =>{
          label=res2.name=="sjb"?"数据吧":res2.name=='internal'?'自研':res2.name
          this.statuslist.push({id:res2.id,name:label+"("+res2.alias+")"})
        })
      }
    },

    onSearchGetList(){
      this.searchData.page_index =1;
      this.getList();
    },
    async getList(){
      utils.showLoading()
      let sd = utils.cloneObj(this.searchData)
      if (this.searchData.business_type === 4 && (this.searchData.warehouse_type == "" || this.searchData.warehouse_type == 17)) {
        sd.business_type = 1
        sd.warehouse_type = 17
      }
      if (this.searchData.business_type === 5 && (this.searchData.warehouse_type == "" || this.searchData.warehouse_type == 17)) {
        sd.business_type = 2
        sd.warehouse_type = 17
      }
      //查询
      let res = await this.RequestPost("query_list",sd);
      if(res.code==0 && res.data != null){
        this.list = [];
        if(res.data.list!=null) this.list = res.data.list;
        this.totalCnt = res.data.total
        this.task_number=res.data.all.task_number
        this.valid_number=res.data.all.valid_number
        // this.list.push({"totalName":"合计","Cnt":res.data.TotalUserCnt});
      }
      await utils.sleepMs(500)
      utils.hideLoading();
    },
    //文件下载
    async addWarehouse(type,row,rowid){
      this.handleType=type;
      let title = "";
      let info = {};
      if(this.handleType==1){
        title = "文件下载";
        info={
          ids:rowid,
          export_format:1,
          export_type:1,
          export_mode:2,
          number_of_single:"",
          file_type:row
        }
      }
      this.onSelectChange("export_mode",info.export_mode);
      this.info=info
      this.formPopIndex=await utils.showFormPage(
        { title: title,el:this.$parent.$el,labelWidth:150,width:700,cancelBtnStatus:0},
        this.info,
        this.format,
        this.ruleValidate,
        this.updateInfo,
        this.onSelectChange,
      );
    },
    //导出
    async addWarehouse2(type,row,rowid,Duo){
      this.handleType=type;
      let title = "";
      let info = {};
      this.Dus=Duo
      //rowid.business_type==性别判断
      if(this.Dus!="单"){
        this.format.export_mode.labelValue=[{"key":2,"value":"全部导出"}]
        this.format.batched_file_count.labelHide=false
      }else{
        this.format.export_mode.labelValue=[{"key":2,"value":"全部导出"},{"key":1,"value":"分批导出"}]
        this.format.batched_file_count.labelHide=true
      }
      if(row==3){
        this.format.export_format.labelValue=[{"key":1,"value":"TXT格式"}]
        if(this.handleType==1){
        title = "导出";
        info={
          ids:rowid.id,
          export_format:1,
          export_type:1,
          export_mode:2,
          number_of_single:"",
          batched_file_count:1,
          file_type:row,
          warehouse_type:rowid.warehouse_type,
          row:rowid
        }
      }
      }else if(row==2){
        this.format.export_format.labelValue=[{"key":2,"value":"CSV格式"}]//{"key":1,"value":"TXT格式"},
          if(this.handleType==1){
            title = "导出";
            info={
              ids:rowid.id,
              export_format:2,
              export_type:1,
              export_mode:2,
              number_of_single:"",
              file_type:row,
              warehouse_type:rowid.warehouse_type,
              row:rowid
            }
        }
      }
      this.onSelectChange("export_mode",info.export_mode);
      this.info=info
      this.formPopIndex=await utils.showFormPage(
        { title: title,el:this.$parent.$el,labelWidth:150,width:700,cancelBtnStatus:0},
        this.info,
        this.format,
        this.ruleValidate,
        this.updateInfo,
        this.onSelectChange,
      );
    },
    onCheckChange(rows){
        this.selectRows = [];
        this.selectRows = rows;
        if(rows.records.length==0){
          this.selectRows = [];
        }
    },
     //导出列表
    async downloadFile() {
      let sd = utils.cloneObj(this.searchData)
      if (this.searchData.business_type === 4 && (this.searchData.warehouse_type == "" || this.searchData.warehouse_type == 17)) {
        sd.business_type = 1
        sd.warehouse_type = 17
      }
      if (this.searchData.business_type === 5 && (this.searchData.warehouse_type == "" || this.searchData.warehouse_type == 17)) {
        sd.business_type = 2
        sd.warehouse_type = 17
      }
      sd.op = "export"
      //查询
      let res = await this.RequestPost("query_list",sd);
        if(res.code==0){
          utils.hideLoading()
            await utils.sleepMs(500);
            window.location.href = ACDN+res.data
        }else{
          utils.showSureModal({"icon":require('../../assets/images/peach-svg/hongtan.svg'),
          "modalContent":"导出异常",
          "title":"提示"});
        }
    },
    async updateInfo(info) {
      utils.showLoading()
      let code = -1;
      let actionName = '';
      let tipText = '';
      let res = '';
      let postData = utils.cloneObj(info);
      console.log(info,"indodoodo")
      let new_ids=""
      let warehouse_type=''
      if (this.handleType==1) {
        if( this.selectRows.length != 0  &&  this.selectRows.records.length != 0){
          this.selectRows.records.forEach(item => {
            new_ids+='|'+item.id
            warehouse_type+='|'+item.warehouse_type
          });
          if(new_ids!=''){
            new_ids=new_ids.substring(1)
            warehouse_type=warehouse_type.substring(1)
          }
          actionName = 'download_items';
          tipText = '下载成功！';
          postData["file_type"]=info.file_type
          if (new_ids.split("|").length > 1 && this.Dus!="单") {
			      postData["ids"]=new_ids
            postData["batched"]=1
            postData["warehouse_type"]=warehouse_type
          }
          let ids = info.ids
          if (ids == undefined) {
            ids = new_ids
          }
          if (this.Dus=="单") {
            postData["ids"]=ids
          }
          postData["business_type"]=info.row.business_type
          delete postData["row"]
        }else{
          actionName = 'download_items';
          tipText = '下载成功！';
          postData["file_type"]=info.file_type
          postData["warehouse_type"]=info.row.warehouse_type
          postData["business_type"]=info.row.business_type
          delete postData["row"]
        }
      }
      if((postData["number_of_single"]<100 || postData["number_of_single"]>1000000)&&postData["export_mode"]==1){
        // alert("单次文件筛选数限制:1000<数量<100w")
        utils.hideLoading();
        utils.showSureModal({"modalContent":"限制:100<数量<100w"});
      }else{
        res = await this.RequestPost(actionName, postData);
        code = res.code;
        if (code == 0) {
          let aaa=ACDN+res.data
          //下载txt判断
            let index= res.data.lastIndexOf(".");//获取.的下标
            let ext = res.data.substr(index+1);//获取后缀txt
            let index2= res.data.lastIndexOf("/");//获取/的下标
            let ext2 = res.data.substr(index2+1,res.data.length);//获取/后的文件名
          if("txt".indexOf(ext.toLowerCase()) !== -1){
            this.exportData2(aaa,ext2)
          }else{
            window.open(ACDN+res.data)
          }
          utils.hideFormPage(this.formPopIndex);
          await utils.sleepMs(1000);
          this.selectRows = [];
          this.onSearchGetList();
          utils.showTip(tipText);
        }
        else{
          utils.showSureModal({"icon":require('../../assets/images/peach-svg/hongtan.svg'),
          "modalContent":res.data,
          "title":"提示"});
        }
        utils.hideLoading();
      }
    },
    //txt下载
    exportData2(url,name){
     const link = document.createElement("a");
      fetch(url)
      .then((res)=>res.blob())
      .then((blob)=>{
       link.href = URL.createObjectURL(blob)
       link.download = name
       document.body.appendChild(link)
       link.click()
        document.body.removeChild(link)
      })
     }
      ,
    //源文件下载
    async addSieveOpen(value){
      // utils.showLoading("正在生成中")
      let new_ids=""
      if(this.selectRows.checked==true && this.selectRows.records.length==1){
        this.addWarehouse(1,value)
      }else{
         utils.showSureModal({"icon":require('../../assets/images/peach-svg/bluegth.svg'),
         "modalContent":"请选择一项 ",
         "title":"提示"});
      }
    },
    //批量导出文件下载（去重）
    async addSieveOpen2(value){
      // utils.showLoading("正在生成中")
      if (this.selectRows.length === 0) {
        utils.showSureModal({"icon":require('../../assets/images/peach-svg/bluegth.svg'),
          "modalContent":"请至少选择一项 ",
          "title":"提示"})
          return
      }

      if(this.selectRows.records.length >= 1) {
        console.log("==========================", this.selectRows)
        let singleOrMore = this.selectRows.records.length > 1 ? "多" : "单"
        console.log("++++++++++++++++++++++++++", singleOrMore)
        return this.addWarehouse2(1, value, this.selectRows, singleOrMore)
      }
    },
    onChangePageSize(page,pageSize){
      this.modal = true
      this.searchData.page_index = page;
      this.searchData.page_size = pageSize;
      this.getList();
    },
    changeDate(){
      // this.searchTime.forEach((item,index)=>{
      //     let hour = item.split(":")[0]
      //     this.searchDate[index].setHours(hour);
      //     if(index==1){
      //       this.searchDate[index].setMinutes(59)
      //       this.searchDate[index].setSeconds(59)
      //     }
      //   })
      this.searchData.start = Date.parse(this.searchDate[0])/1000;
      this.searchData.end = Date.parse(this.searchDate[1])/1000+86400;
      this.onSearchGetList();
    },
    initDate(){
      let nowDay = ""
      let beginDay = nowDay;
      let endDay = nowDay;
      this.searchDate = [new Date(beginDay),new Date(endDay)];
      this.changeDate();
    },
    slotHeader(h) {
    //   return [h("div",{class:{"allCount":true},"style":{"margin-left":"10px"}})]
    },
    //总计
    footerMethodFunc({ columns, data }){
      return [columns.map((item,index) => {
          if(index ==0){
            return '总计'
          }else if(['任务数'].includes(item.title)){
            return this.task_number
          }else if(['有效数'].includes(item.title)){
            return this.valid_number
          }
          return null
        })
      ]
    },
    filterPartner(item){
      if (item.Id == -1) return true;
      if (this.searchData.searchBusinessId == -1 ) return true
        return item.BusinessId==this.searchData.searchBusinessId;
    },
    filterChannel(item){
      if(this.searchData.searcPartnerId == undefined) {
        this.searchData.searcPartnerId = -1
      }
      if(this.searchData.searchBusinessId == undefined) {
        this.searchData.searchBusinessId = -1
      }

      if (item.Id == -1) return true;
      if ( this.searchData.searchBusinessId == -1 && this.searchData.searcPartnerId == -1 ) return true
      if ( this.searchData.searchBusinessId == -1 && this.searchData.searcPartnerId != -1 && item.PartnerId==this.searchData.searcPartnerId ) return true
      if ( this.searchData.searchBusinessId != -1 && this.searchData.searcPartnerId != -1 && item.PartnerId==this.searchData.searcPartnerId ) return true
      if ( this.searchData.searchBusinessId != -1 && this.searchData.searcPartnerId == -1 && item.BusinessId==this.searchData.searchBusinessId ) return true
    },
    async onSelectChange(label,value){
      this.format.number_of_single.labelHide = true;
       if(label=="export_mode"){
          if(value==1){
            this.format.number_of_single.labelHide = false;
          }
       }
    },
  },
  mounted() {
    bus.$on('linevalid',data =>{
        this.list=data
      })
  },
};
</script>
